﻿@using Eqwww.Config
@inject IAppConfigProvider AppConfigProvider

@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_ManageIndexLayout.cshtml";
}

@{
    var appConfig = AppConfigProvider.Load();
}

    <div class="mdui-appbar mdui-shadow-1 mdui-color-white" id="xd-appbar">
        <div class="mdui-toolbar">

            <a id="refreshBtn" class=" mdui-btn mdui-ripple mdui-ripple-black" href="javascript:;">
                <i class="mdui-icon material-icons">refresh</i> 刷新
            </a>
            <div class="mdui-toolbar-spacer"></div>


            <module-buttons class="mdui-btn-group" buttons="@ViewBag.InitialButtons"></module-buttons>


        </div>
    </div>

<div class="mdui-container-fluid mdui-m-b-1">
    <div class="mdui-row">
        <div class="mdui-col-xs-12 mdui-m-t-1 ">

            <div class="mdui-card" style="border-radius:5px;">
                <div class="mdui-card-content">

                    <div class="mdui-list  eq-appconfig">
                        
                        <div class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">android</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-text">系统名称</div>
                                <div class="mdui-list-item-title">@appConfig.AppName</div>
                            </div>
                        </div>
                        <div class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">code</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-text">版本</div>
                                <div class="mdui-list-item-title">@appConfig.AppVersion</div>
                            </div>
                        </div>
                        <div class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">lock_open</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-text">系统状态</div>
                                <div class="mdui-list-item-title">
                                    @if (appConfig.IsOpen)
                                    {
                                        <text>开放</text>
                                    }
                                    else
                                    {
                                        <text>关闭</text>
                                    }
                                </div>
                            </div>
                        </div>
                        <div class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">color_lens</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-text">默认主题色</div>
                                <div class="mdui-list-item-title mdui-text-color-theme">
                                  
                                            @appConfig.DefaultThemeColor
                                        
                                </div>
                            </div>
                        </div>
                        <div class="mdui-list-item mdui-ripple">
                            <i class="mdui-list-item-icon mdui-icon material-icons">color_lens</i>
                            <div class="mdui-list-item-content">
                                <div class="mdui-list-item-text">默认强调色</div>
                                <div class="mdui-list-item-title mdui-text-color-theme-accent">
                                            @appConfig.DefaultAccentColor
                                      
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

            
        </div>
        
    </div>
</div>


@section Scripts{
    <script>
        $(function () {

            $('#refreshBtn').click(function () {
                window.location.reload();
            });


            $('.eq-appconfig').find('.mdui-list-item').bind('click', function () {
                $.modalOpen({
                    id: 'AppConfigForm',
                    title: '系统设置',
                    url: '/SystemManage/ConfigManage/AppConfigForm',
                    width: '100%',
                    height: '100%',
                    callBack: function (iframeId) {
                        top.frames[iframeId].submitForm();
                    }
                });
            });
        });

        function btn_appconfig() {
            $.modalOpen({
                id: 'AppConfigForm',
                title: '系统设置',
                url: '/SystemManage/ConfigManage/AppConfigForm',
                width: '100%',
                height: '100%',
                callBack: function (iframeId) {
                    top.frames[iframeId].submitForm();
                }
            });
        }

        function btn_emailconfig() {
            $.modalOpen({
                id: 'EmailConfigForm',
                title: '邮件参数设置',
                url: '/SystemManage/ConfigManage/EmailConfigForm',
                width: '100%',
                height: '100%',
                callBack: function (iframeId) {
                    top.frames[iframeId].submitForm();
                }
            });
        }
    </script>
    
}

